package lab02.test37;

import java.util.Scanner;

public class StudentDemo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Student student[] = new Student[2];

        student[0]=new UnderGraduate();
        student[0].name="张三";
        student[0].type="本科生";
        student[0].scores[0]=85;
        student[0].scores[1]=85;
        student[0].scores[2]=85;

        student[1]=new Graduate();
        student[1].name="李四";
        student[1].type="研究生";
        student[1].scores[0]=75;
        student[1].scores[1]=85;
        student[1].scores[2]=75;

        for (int i=0; i<2; i++){
            System.out.println(student[i].type+student[i].name+
                    "   "+student[i].average());
        }

      /* for (int i = 0; i < 2; i++) {
            System.out.println("请输入学生学历：");
           String type = scanner.nextLine();
           if (type.equals("本科生")) {
               student[i] = new Graduate();
               System.out.println("请输入学生姓名：");
                student[i].name = scanner.nextLine();
               System.out.println("请输入学生三科成绩：");
               for (int j = 0 ; j<3;j++){
                   student[i].scores = new double[3];
                   student[i].scores[j]=scanner.nextDouble();
                }
                student[i].average();
               System.out.println(type + student[i].name + " "+student[i].average());
            }else if (type.equals("研究生")) {
               student[i] = new UnderGraduate();
                System.out.println("请输入学生姓名：");
                student[i].name = scanner.next();
                System.out.println("请输入学生三科成绩：");
                for (int j = 0 ; j<3;j++){
                    student[i].scores = new double[3];
                    student[i].scores[j]=scanner.nextDouble();
                }
                student[i].average();
               System.out.println(type + student[i].name + " "+student[i].average());
            }
        }*/
    }
}
